package wtflog

import (
	"sync"
)

type Logger interface {
	Info(vs ...interface{})
	Warn(vs ...interface{})
	Error(vs ...interface{})
}

var (
	globalLock    sync.Mutex
	defaultLogger Logger = NewTextLogger()
	globalLogger  Logger = defaultLogger
)

func GlobalLogger() Logger {
	globalLock.Lock()
	defer globalLock.Unlock()
	return globalLogger
}

func SetGlobalLogger(logger Logger) {
	globalLock.Lock()
	globalLogger = logger
	globalLock.Unlock()
}
